home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
emacsfilereq
/
filereq.doc
< prev
next >
Wrap
Text File
|
1999-09-13
|
5KB
|
155 lines
F I L E R E Q
-------------
Matti Rintala 1993
Use ReqTools filerequester with GnuEmacs
First of all, if you use filereq, PLEASE SEND ME E-MAIL (or a
postcard)! I like getting mail... :-)
What does filereq do?
I've always wanted GnuEmacs to ask for files with a decent graphical
filerequester. I mean, there are menus but what good is selecting
'Open' from menu if you have to type in the filename using keyboard
anyway!
Filereq is an Emacs elisp file (two if you count the byte-compiled
version, four if you count the menu files) and an arexx script that
enables you to use ReqTools filerequester in Emacs.
Note however, that filereq does not 'overwrite' functions using the
existing file requesting method of Emacs (the minibuffer), but it
defines its own functions that are then mapped to the same keys as the
old ones, if so wanted.
Copyright
The elisp files and the arexx script which form filereq are public
domain. This means you may use them freely and copy them to your
friends as long as you don't make money with it. The only thing I ask
is that my name stays with the files.
I usually prefer much longer copyright messages, but this utility is
so small that what the heck.
System requirements
What you need is:
- An Amiga
- OS 2.x (to run Emacs)
- GnuEmacs ported to Amiga (filereq was made with GnuEmacs 18.58,
Amiga port 1.26DG, ported by Dvaid Gay)
- ARexx (comes with 2.x)
- ReqTools.library by Nico François (can be found in many ftp places
and in fish disks)
- RexxReqTools.library by Rafael D'Halleweyn (comes nowadays with
ReqTools, at least did with version 2.1d)
Installation
1) Copy FileReq.elx to Rexx: directory
2) Copy filereq.el and filereq.elc to GnuEmacs:lisp directory
3) If you want to use my menu definitions, copy filereq-menu.menu and
filereq-menu.el to GnuEmacs:lisp, too
How to test
Simple. Say 'M-x load-file GnuEmacs:lisp/filereq.elc' (with RETURN
between the load-file and the filename, of course). Now the new
functions have been defined. To change default key mappings (provided
you haven't mapped the file commands to other keys) say 'M-x
filereq-set-keys'. Now the keys 'C-x C-f', 'C-x C-w', 'C-x C-r', 'C-x
C-v', 'C-x i', 'C-x 4 C-f' and 'C-x 4 f' should do their functions
with filerequester. If the notation used in the keys is not familiar
to you or you don't know what the key sequences are supposed to do,
contact your Emacs info or manual.
To try the menus say 'M-x load-file GnuEmacs:lisp/filereq-menu.el'.
Now the menus should use filerequesters. Note that 'filereq.elc' must
already have been loaded before using the menus.
How to set filereq up permanently
Edit your s:.emacs file. Add (to the end, for example) the line
(load "filereq" nil t nil)
If you want the keys ('C-x C-f' etc.) to use filerequesters, add after
that the line
(filereq-set-keys)
If you want the menus, copy filereq-menu.el to s:.emacs-menu.el and
filereq-menu.menu to s:.emacs-menu.menu.
Thats it.
How is filereq done?
Filereq's basis is the function 'filereq-read-file-name' which starts
the arexx script FileReq.elx which in turn uses RexxReqTools.library
which in turn uses ReqTools.library to bring up the file requester.
FileReq.elx then commands Emacs (via arexx again) to store the file
name entered to variable filereq-filename.
filereq-read-file-name takes four arguments:
prompt: The prompt displayed in the title bar of the
requester
directory: Initial directory
filename: Initial filename
exist: nil if file does not have to exist, t if it
does.
Using this function six other functions are defined, which simply call the
function above to get the filename and then call the function they are
meant to replace. These functions are:
filereq-find-file: Replacement for find-file
filereq-write-file: Replacement for write-file
filereq-find-file-read-only: Replacement for find-file-read-only
filereq-fine-alternate-file: Replacement for find-alternate-file
filereq-insert-file: Replacement for insert-file
filereq-find-file-other-window: Replacement for find-file-other-window
It is of course very easy to write replacements for the rest of the
file functions, but these functions are normally mapped to the
keyboard, so I've only included them.
The function filereq-set-keys simply uses global-set-key to redifine
some key sequences.
The menus are quite straightforward as they simply have the
filereq-functions in their entrys.
I hope you have use for filereq!
DON'T FORGET THE E-MAIL (OR A POSTCARD)!!
Here's the address:
email: bitti@cs.tut.fi
Matti Rintala
Pyykkiojankatu 2 C 24
33710 TAMPERE
FINLAND